package com.example.demo.controller;

import com.example.demo.service.CourseService;
import com.example.demo.service.UserService;
import com.example.demo.vo.Login;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * @author ：hantao
 * @date ：Created in 2024/12/26 10:04
 * @description：
 */
@Controller
@RequestMapping("/user")
public class UserController {
	@Autowired
	private UserService userService;

	@Autowired
	private CourseService courseService;

	@GetMapping("/list")
	public String list() {
		userService.getUserName();
		String course = courseService.getCourse().toString();
		System.out.println(course);
		return "user/list";
	}

	@GetMapping("/add")
	public String add() {
		Login login1 = new Login();
		login1.setEmail("123@qq.com");
		login1.setPassword("123456");
		userService.addUser(login1);
		return "user/add";
	}
}
